package com.wlyuan.open.domain.source.repository;

import com.wlyuan.core.domain.repository.BaseRepository;
import com.wlyuan.open.domain.source.*;

import java.util.List;

/**
 * @author yuanzheng
 */
public interface SourceRepository extends BaseRepository<SourceData, SourceDataId> {
    /**
     * 保存关系数据
     *
     * @param relation
     */
    void save(SourceRelation relation);

    /**
     * 查询关系数据
     *
     * @param pattern
     * @return
     */
    SourceRelation ofPattern(SourcePattern pattern);

    /**
     * 根据sourceKey查询源数据
     *
     * @param pattern
     * @return
     */
    SourceDataId ofSourcePattern(SourcePattern pattern);

    /**
     * 修改
     *
     * @param id
     * @param status
     * @param remark
     */
    void updateSource(SourceDataId id, Integer status, String remark);

    /**
     * 查询sourceKey
     *
     * @param pattern
     * @return
     */
    List<String> ofFailPattern(SourceDataPattern pattern);
}
